home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / p / pcqpascalv1.2d.lha / Examples / Typer.p < prev    next >
Encoding:
Text File  |  1990-07-19  |  613 b   |  31 lines

  1. Program Typer;
  2.  
  3. {
  4.     Demonstrates the use of the PCQ Pascal IO routines by
  5.     implementing something like the AmigaDOS TYPE command.
  6. }
  7.  
  8. var
  9.     Infile : Text;
  10.     InfileName : String;
  11.  
  12. {$I "Include:Utils/StringLib.i"}
  13. {$I "Include:Utils/Parameters.i"}
  14.  
  15. begin
  16.     InfileName := AllocString(80);
  17.     GetParam(1, InfileName);
  18.     if InfileName^ = Chr(0) then begin
  19.     Writeln('No filename specified');
  20.     Exit(10);
  21.     end;
  22.     if reopen(InfileName, Infile) then begin
  23.     while not eof(Infile) do begin
  24.         write(Infile^);
  25.         get(Infile);
  26.     end;
  27.     close(Infile);
  28.     end else
  29.     writeln('Could not open the input file.');
  30. end.
  31.